<template>
  <div style="width:100%;height:600px;"></div>
</template>

<script>
import {z} from "../utils/data";
import echarts from "echarts";

export default {
  name: "zxt.vue",
  props: ["xAxis1", "xAxis2", "series", "text", "changeData"],
  watch: {
    changeData() {
      const legend = this.series.map(item => {if(item) return item.name});
      const myChart = echarts.init(this.$el);
      z(myChart, this.text, this.xAxis1, this.xAxis2, this.series, legend);
    }
  },
  mounted() {
    const legend = this.series.map(item => {if(item) return item.name});
    const myChart = echarts.init(this.$el);
    z(myChart, this.text, this.xAxis1, this.xAxis2, this.series, legend);
  }
};
</script>

<style scoped>
</style>